﻿#ifndef APPSENCE_H
#define APPSENCE_H

#include <QList>
#include <QHash>
#include <QString>

#include "stock.h"

/**
 * @brief The AppSence class 应用场景，管理item(本例程中为Stock对象)的组织和所用权
 */
class AppSence
{
public:
    AppSence();

    void addStock(Stock *stock);

    void setCurrentStock(QString stockID);

    QList<QString> allStockID();

    Stock* currentStock();

private:
    QHash<QString, Stock*> m_stockMap;
    Stock* m_currentStock = nullptr;
};

#endif // APPSENCE_H
